package cn.wolfcode.domain;

import cn.wolfcode.enums.SubjectTitleEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class Exam {
    /**
     *
     */
    private Long id;

    /**
     * 试卷名称
     */
    private String title;

    /**
     * 考试时长
     */
    private Integer examMinute;

    /**
     * 试卷总分
     */
    private Integer totalScore;

    private Integer singleNumber;
    private Integer multiNumber;
    private Integer judgeNumber;
    private Integer singleScore;
    private Integer multiScore;
    private Integer judgeScore;

    public Integer getScore(SubjectTitleEnum subjectTitleEnum) {
        switch (subjectTitleEnum.getValue()) {
            case 1:
                return singleNumber * singleScore;
            case 2:
                return multiNumber * multiScore;
            case 3:
                return judgeNumber * judgeScore;
            default:
                return null;
        }

    }

}